home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mntdoc01.zoo / mintdoc / cat3 / l64a.3 < prev    next >
Encoding:
Text File  |  1993-03-03  |  2.0 KB  |  67 lines

  1.  
  2.  
  3.  
  4. A64L(3)             MINTLIB LIBRARY FUNCTIONS             A64L(3)
  5.  
  6.  
  7. N✓NA✓AM✓ME✓E
  8.        a64l,  l64a  -  convert  between  long integer and base-64
  9.        ASCII string
  10.  
  11. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  12.        #include <support.h>
  13.  
  14.        long a64l(const char *s);
  15.  
  16.        char *l64a(long l);
  17.  
  18. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  19.        These functions are used to  maintain  numbers  stored  in
  20.        base-64 ASCII characters. This is a notation by which long
  21.        integers can be represented by up to six characters;  each
  22.        character represents a "digit" in a radix-64 notation.
  23.  
  24.        The  characters  used to represent "digits" are . for 0, /
  25.        for 1, 0 through 9 for 2-11, A through Z for 12-37, and  a
  26.        through z for 38-63.
  27.  
  28.        a64l  takes  a pointer to a null-terminated base-64 repre-
  29.        sentation and returns a corresponding long value.  If  the
  30.        string  pointed to by s contains more than six characters,
  31.        a64l will use the first  six.  a64l  scans  the  character
  32.        string  from left to right, decoding each character as a 6
  33.        bit radix-64 number. If the string contains illegal  char-
  34.        acters, -1 is returned and errno is set to EBADARG.
  35.  
  36.        l64a  takes  a  long argument and returns a pointer to the
  37.        corresponding base-64 representation. If the  argument  is
  38.        0,  a64l  returns a pointer to a null string. If the argu-
  39.        ment is smaller than zero, a pointer to a null  string  is
  40.        returned and errno is set to EBADARG.
  41.  
  42. C✓CA✓AV✓VE✓EA✓AT✓TS✓S
  43.        The  value  returned  by  l64a  is a pointer into a static
  44.        buffer, the contents of  which  are  overwritten  by  each
  45.        call.
  46.  
  47.        The  value  returned by a64l may be incorrect if the value
  48.        is too large; for that reason, only strings that  resulted
  49.        from a call to l64a should be used to call a64l.
  50.  
  51.        Maybe  these  calls  should  use unsigned long values, but
  52.        longs are used here to retain compatibility with UN*X Sys-
  53.        tem V.
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. MiNT docs 0.1              3 March 1993                         1
  65.  
  66.  
  67.